Skip to content

Conversation

DA-344
Copy link
Contributor

@DA-344 DA-344 commented Mar 23, 2025

Summary

Adds support for receiving, setting, and updating a Scheduled Event's recurrence rule.

Documentation: resources/guild-scheduled-event

Needs testing.

Information

  • This PR fixes an issue.
  • This PR adds something new (e.g. new method or parameters).
  • This PR is a breaking change (e.g. methods or parameters removed/renamed).
  • This PR is not a code change (e.g. documentation, README, typehinting,
    examples, ...).

Checklist

  • I have searched the open pull requests for duplicates.
  • If code changes were made then they have been tested.
    • I have updated the documentation to reflect the changes.
  • If type: ignore comments were used, a comment is also left explaining why.
  • I have updated the changelog to include these changes.

Comment on lines 256 to 290
@property
def weekdays(self) -> list[WeekDay]:
"""Returns a read-only list containing all the specific days
within a week on which the event will recur on.
"""
if self._weekdays is MISSING:
return []
return self._weekdays.copy()

@property
def n_weekdays(self) -> list[NWeekDay]:
"""Returns a read-only list containing all the specific days
within a specific week on which the event will recur on.
"""
if self._n_weekdays is MISSING:
return []
return self._n_weekdays.copy()

@property
def month_days(self) -> list[datetime.date]:
"""Returns a read-only list containing all the specific days
within a specific month on which the event will recur on.
"""
if self._month_days is MISSING:
return []
return self._month_days.copy()

@property
def year_days(self) -> list[int]:
"""Returns a read-only list containing all the specific days
of the year on which the event will recur on.
"""
if self._year_days is MISSING:
return []
return self._year_days.copy()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason these are read-only properties?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because as recurrence rules can be both received by API/Gw and created by users, I thought it would be better to make these properties read only and if the user wants to edit the rrule they use edit instead. (Similar as dateutil.rrule.rrule.replace)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Read only makes more sense to me

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That seems inconsistent to me, no other object in the library does this

Comment on lines +321 to +322
If this recurrence rule was obtained from the API you will need to
:meth:`.copy` it in order to edit it.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one more question... why?

@Lulalaby
Copy link
Member

Lulalaby commented Aug 2, 2025

Merge conflicts
(complicated discord feature, requires intense testing)

@Paillat-dev Paillat-dev added API reflection Discord API isn't correctly reflected hold: testing This pull request requires further testing labels Aug 6, 2025
@Lulalaby Lulalaby requested a review from a team as a code owner August 30, 2025 20:33
@Lulalaby Lulalaby force-pushed the master branch 2 times, most recently from b55c125 to 82659b2 Compare August 30, 2025 21:10
@Lulalaby Lulalaby removed the on hold label Aug 30, 2025
@Lulalaby Lulalaby requested a review from a team as a code owner September 1, 2025 12:31
@Paillat-dev Paillat-dev self-assigned this Sep 1, 2025
@Paillat-dev Paillat-dev self-requested a review September 1, 2025 15:41

.. attribute:: monday

Monday, the first day of the week. Index of 0.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😭

@Lulalaby
Copy link
Member

Lulalaby commented Sep 1, 2025

@DA-344 went ahead and fixed the merge conflicts for you. please double check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API reflection Discord API isn't correctly reflected hold: testing This pull request requires further testing PA: All Contributors pending PA: Maintainers pending
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants